package vn.edu.uit.game_show;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.GridView;
import android.widget.ImageView;

public class ElementsAdapter extends BaseAdapter{
	
	Context context;
	LayoutInflater mInflater;
	
	public ElementsAdapter(Context ctx) {
		this.context = ctx;
		mInflater = LayoutInflater.from(ctx);
	}

	public int getCount() {
		// TODO Auto-generated method stub
		return 32;
	}

	public Object getItem(int pos) {
		// TODO Auto-generated mthod stub
		return null;
	}

	public long getItemId(int pos) {
		// TODO Auto-generated method stub
		return 0;
	}
	
	public class ItemElements {
		public ImageView imgDisappear;
	}

	public View getView(int pos, View view, ViewGroup parent) {
		
		ItemElements holder;
		
		if (view == null) {
			view = mInflater.inflate(R.layout.nguyento_item, null);
			view.setLayoutParams(new GridView.LayoutParams(55, 55));
			holder = new ItemElements();
			holder.imgDisappear = (ImageView) view.findViewById(R.id.imgDisappear);			
			view.setTag(holder);
		} else {
			holder = (ItemElements) view.getTag();
		}
		
		holder.imgDisappear.setAdjustViewBounds(true);
		holder.imgDisappear.setScaleType(ImageView.ScaleType.CENTER_CROP);
		
		return view;
	}

}
